package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 删除状态枚举
 * @author: mYunYu
 * @date: 2021/7/27 14:30
 * @version: v1.0
 */
public enum DeleteStatusEnum {

    NORMAL(0, "正常"),
    DELETED(1, "已删除"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    DeleteStatusEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static DeleteStatusEnum typeOfValue(Integer value) {
        DeleteStatusEnum[] values = DeleteStatusEnum.values();
        for (DeleteStatusEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static DeleteStatusEnum typeOfName(String name) {
        DeleteStatusEnum[] values = DeleteStatusEnum.values();
        for (DeleteStatusEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
